package com.bishe.demo.modules.hotel.hotelPolicy.dao;

import com.bishe.demo.modules.hotel.hotelPolicy.entity.MenuType;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface MenuTypeDao {
    @Insert("insert into hotel_menu_type values(null,#{menuType})")
    @Options(useGeneratedKeys = true, keyProperty = "menuTypeId", keyColumn = "menu_type_id")
    void insertMenuType(MenuType menuType);

    @Select("select * from hotel_menu_type hmt left join hotel_breakfast_menu_type hbmt on hbmt.menu_id=hmt.menu_type_id where hbmt.breakfast_id=#{breakfastId}")
    List<MenuType> getMenuTypesByBreakfastId(int breakfastId);

    @Delete("delete from hotel_menu_type where menu_type_id=#{menuTypeId}")
    void deleteByMenuTypeId(int menuTypeId);
}
